<?php
/**
 * Created by PhpStorm.
 * User: Lin
 * Date: 2019/4/9
 * Time: 23:08
 */
namespace IMooc\Database;


use IMooc\Database;

class MySQL implements Database
{
    protected $coon;
    function connect($host, $user, $passwd, $dbname)
    {
        $coon = @mysql_connect($host, $user, $passwd);
        @mysql_select_db($dbname, $coon);
        $this->coon = $coon;
    }
    function query($sql)
    {
        $res = @mysql_query($sql, $this->coon);
        return $res;
    }
    function close()
    {
        @mysql_close($this->coon);
    }
}